<?php
class BaseDatos{
	
	private $servidor="localhost";
	private $user= "root";
	private $clave= "";
	var $con=0;
	
	public function conectar(){
		
	  $conexion= mysql_connect($this->servidor,$this->user,$this->clave )  or die ( "no pudo conectarce: ".mysql_error()); 
	  mysql_select_db("main_db") or dieFunc(); 
	  return $conexion;
	}
	
	public function consulta($query){
		
		$conx=$this->conectar();
	    $resultado=mysql_query($query) or die ( "error en el query: ".$query);	
	    return $resultado;
	}
	
}
?>